#include<stdio.h>
int main()
{
	int n,x;
	int count=0;
	scanf("%d%d",&n,&x);
	while(n>0)
	{
		if(n/2<n-x)
		{
			n=n/2;
		}
		else
		n=n-x;
		count++;
	}
	printf("%d",count);
}
